package com.ruoyi.equipment.mapper;

import java.util.ArrayList;
import java.util.List;

import com.ruoyi.equipment.domain.DrawerVo;
import com.ruoyi.equipment.domain.TDrawer;
import org.apache.ibatis.annotations.Param;


/**
 * 仓匣Mapper接口
 * 
 * @author ruoyi
 * @date 2021-12-20
 */
public interface TDrawerMapper 
{
    /**
     * 查询仓匣
     * 
     * @param equipmentId 仓匣主键
     * @return 仓匣
     */
    public List<TDrawer> selectTDrawerByEquipmentId(String equipmentId);

    /**
     * 查询仓匣列表
     * 
     * @param tDrawer 仓匣
     * @return 仓匣集合
     */
    public List<TDrawer> selectTDrawerList(TDrawer tDrawer);

    /**
     * 新增仓匣
     * 
     * @param tDrawer 仓匣
     * @return 结果
     */


    /**
     * 修改仓匣
     * 
     * @param tDrawer 仓匣
     * @return 结果
     */
    public int updateTDrawer(TDrawer tDrawer);

    /**
     * 批量删除仓匣
     * 
     * @param equipmentIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTDrawerByEquipmentIds(@Param("equipmentIds") String[] equipmentIds, @Param("drawerNos") Integer[] drawerNos);

    /**
     * 获取仓匣具体信息
     * @param tDrawer
     * @return
     */
    TDrawer selectTDrawerDetail(TDrawer tDrawer);

    int popTDrawer(@Param("equipmentIds") String[] equipmentIds,@Param("drawerNos") Integer[] drawerNos);
      //借出仓匣里面的工具
    int lendTDrawer(@Param("equipmentIds") String equipmentIds,@Param("drawerNos") Integer drawerNos);

    Integer getDrawerDetail(@Param("equipmentIds") String[] equipmentIds,@Param("drawerNos") Integer[] drawerNos);


    //循环添加仓匣盒
    void forInsertDrawer(@Param("tDrawerList") List<TDrawer> tDrawerList);
   //
    TDrawer getDrawerByDrawerId(String drawerId);

    TDrawer getDrawerByEquipmentIdAndDrawerNo(@Param("equipmentId") String equipmentId,@Param("drawerNo") String drawerNo);

    void updateTDrawerDrawerId(String drawerId);

    ArrayList<DrawerVo> selectDrawerVo(String drawerId);

    int insertTDrawer(TDrawer tDrawer);

    int deleteTDrawerByEquipmentId(String equipmentId);

}
